package com.big.zipkin.listener;

import com.rabbitmq.client.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.listener.api.ChannelAwareMessageListener;
import org.springframework.stereotype.Component;

/**
 * 链路追踪
 */
@Component
@Slf4j
public class ZipkinListener implements ChannelAwareMessageListener {


    @Override
    @RabbitListener(queues = "zipkin" )
    public void onMessage(Message message, Channel channel) throws Exception {
        String zipkin = new String(message.getBody());
        log.info(zipkin);

    }

}
